package com.ss.android.newmedia.d;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.support.v4.app.Fragment;
import android.webkit.WebView;

import com.bytedance.article.common.c.TTUtils;
import com.bytedance.common.utility.c.SharedPreferenceCompat;
import com.ss.android.account.bb;
import com.ss.android.account.f;
import com.ss.android.common.callback.CallbackCenter;
import com.ss.android.common.dialog.AlertDialog;
import com.ss.android.newmedia.BaseAppData;
import com.ss.android.newmedia.feedback.FeedbackActivity;
import com.ss.android.newmedia.MediaAppData;
import com.ss.android.newmedia.util.AppUtil;

import java.util.List;

public final class a implements f {
    private static a a;

    static {
        a.a = new a();
    }

    public a() {

    }

    public static void a() {
        bb.a().a = com.ss.android.newmedia.d.a.a;
    }

    public final int a(Context arg2, Throwable arg3) {
        return TTUtils.getErrorCode(arg2, arg3);
    }

    public final Intent a(Context arg4, boolean arg5) {
        Intent v0 = new Intent(arg4, FeedbackActivity.class);
        v0.putExtra("key_appkey", BaseAppData.inst().getAppContext().getFeedbackAppKey());
        v0.putExtra("use_swipe", arg5);
        v0.putExtra("tab_name", 2);
        v0.putExtra("anchor", "faq-76");
        return v0;
    }

    public final Uri a(Context arg2, String arg3) {
        return AppUtil.a(arg2, arg3);
    }

    public final AlertDialog.Builder a(Context arg2) {
        return com.ss.android.j.b.createDialogBuilder(arg2);
    }

    public final String a(Context arg2, Uri arg3) {
        return TTUtils.a(arg2, arg3);
    }

    public final void a(Activity arg1, Fragment arg2, int arg3) {
        TTUtils.a(arg1, arg2, arg3);
    }

    public final void a(Activity arg1, Fragment arg2, int arg3, String arg4, String arg5) {
        TTUtils.a(arg1, arg2, arg3, arg4, arg5);
    }

    public final void a(String arg4) {
        BaseAppData v0 = BaseAppData.inst();
        ((MediaAppData)v0).mLastLoginMobile = arg4;
        SharedPreferences.Editor v0_1 = ((MediaAppData)v0).mContext.getSharedPreferences("app_setting", 0).edit();
        v0_1.putString("last_login_mobile", arg4);
        SharedPreferenceCompat.commit(v0_1);
    }

    public final void a(String arg1, WebView arg2) {
        TTUtils.a(arg1, arg2);
    }

    public final void a(boolean arg5, int arg6) {
        BaseAppData.inst().onAccountRefresh(arg5, arg6);
        CallbackCenter.notifyCallback(BaseAppData.callbackTypeAccountRefresh, new Object[]{BaseAppData.callbackTypeAccountRefresh});
    }

    public final Class b() {
        return BaseAppData.inst().af();
    }

    public final List c() {
        BaseAppData v0 = BaseAppData.inst();
        if(android.support.design.a.isTextEmpty(((MediaAppData)v0).mMobileRegexAndroid)) {
            ((MediaAppData)v0).mMobileRegexAndroid = "[[\'^(\\\\+86)?(1\\\\d{10})$\', \'$2\']]";
        }

        List v0_1 = MediaAppData.k(((MediaAppData)v0).mMobileRegexAndroid);
        if(v0_1.isEmpty()) {
            v0_1 = MediaAppData.k("[[\'^(\\\\+86)?(1\\\\d{10})$\', \'$2\']]");
        }

        return v0_1;
    }

    public final void d() {
        BaseAppData.inst().H();
    }

    public final String e() {
        return BaseAppData.inst().cc;
    }
}

